feat: apply provision configuration atomically - #3
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 变更描述 / Description
metaproxy 的渠道和计费倍率原先通过多个管理接口依次写入,任一步失败都会留下混合配置。本 PR 为 metaproxy fork 增加 root-only 原子发布接口:同一事务内替换带
metaproxy-provision标签的渠道、abilities、模型倍率和分组倍率,并用配置摘要做 CAS 与幂等重试。事务提交后不逐项刷新运行时缓存。进程会冻结定时同步,继续使用完整旧配置;宿主重启 new-api 后才从数据库装入完整新配置。
/api/status暴露当前进程已加载的摘要,部署系统据此判断是否真正生效。本实现由 Codex 辅助完成,提交者已检查变更范围和验证结果;合并前还会使用 Gemini 3.7 Flash 独立审查。
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
📸 运行证明 / Proof of Work
go test ./model ./controller ./router -run TestApplyMetaproxyProvision|TestValidateMetaproxyProvisionRequest -count=1metaproxy-newapi:devalready_applied=true、restart_required=falsego test ./...的新增包通过;仓库既有失败为根包缺少web/*/dist,以及单独运行也失败的 affinity 计数测试Agent: GPT-5.6 Sol via T3 Code